home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-10-17 | 8.0 KB | 489 lines | [TEXT/ALFA] |
- ;/**********************************************************
- ;* *
- ;* Copyright © 1991 Robert L. Dewar. All rights reserved. *
- ;* *
- ;***********************************************************/
-
-
- (set sectionExpr "\\(sub)*section{.*}$")
- (define setTexMode
- set elecLBrace 0
- set elecRBrace 0
- set electricSemi 0
- set wordWrap 1
- set fillColumn 75
- set paraBegin "(^[ \t]*\r|\r\\.*)"
- set paraEnd "\r([ \t]*$|\\.*)"
- (bind '\79' nextSection) ; 'page down'
- (bind '\74' prevSection) ; 'page up'
- set leftFillColumn 0)
-
- (bind '\12' <o> transposeChars) ; opt-1
- (bind '\13' <o> transposeWords) ; opt-2
- (bind '\2c' <c> gotoLine) ; cmd-/
- (bind '\53' setMark) ; Keypad 1
- (bind '\54' markHilite) ; Keypad 2
- (bind '\4e' beginningOfBuffer) ; Keypad -
- (bind '\46' <s> endOfBuffer) ; Keypad +, Mac Plus
- ;(bind '\45' endOfBuffer) ; Keypad +, Mac LC
-
- (define startMathCtlSeq
- setMark
- type "\\"
- )
- (bind '\2a' <o> startMathCtlSeq) ; opt-\
-
- (define commentLine ;need to work out how to comment a selection: ACMD?
- beginningOfLine
- type "% "
- nextLine
- beginningOfLine)
- (bind '\47' <c> commentLine) ; Keypad CMD-Clear
-
- (define unCommentLine ;need to work out how to uncomment a selection:ACMD?
- beginningOfLine
- setMark
- 2 forwardChar
- cut
- nextLine
- beginningOfLine)
- (bind '\47' <co> unCommentLine) ; Keypad OPT-CMD-Clear
-
- (define backwardSelectWord
- setMark
- backwardWord
- markHilite
- )
- (bind '\59' backwardSelectWord) ; Keypad 7
-
- (define backwardExtendSelWd
- backwardWord
- markHilite
- )
- (bind '\59' <s> backwardExtendSelWd) ; Shift-Keypad 7
-
- (define bkwdSelectCtlSeq
- saveVars ; Save variables' values.
- mark "nurke"
- backwardChar
- set regExpr on
- set forward off
- set matchWords off
- search "[ \r\t]"
- forwardChar
- goto "nurke"
- markHilite
- restoreVars ; Restore the variables' original values.
- deletemark "nurke"
- )
- (bind '\52' bkwdSelectCtlSeq) ; Keypad 0
-
- (define bkwdXtendSelCtlSeq
- saveVars ; Save variables' values.
- cut
- mark "fred"
- paste
- mark "nurke"
- goto "fred"
- 2 backwardChar
- set regExpr on
- set forward off
- set matchWords off
- search "[ \r\t]"
- forwardChar
- goto "nurke"
- markHilite
- restoreVars ; Restore the variables' original values.
- deletemark "fred"
- deletemark "nurke"
- )
- (bind '\52' <s> bkwdXtendSelCtlSeq) ; Shift-Keypad 0
-
- (define dollarize
- cutclip "fred" ; Use named clipboard to avoid corrupting ordinary
- clipboard
- type "$"
- yankclip "fred"
- type "$"
- )
- (bind '\5b' dollarize) ; Keypad 8
- (bind '\41' dollarize) ; Keypad .
-
- (define bracketize
- cutclip "fred"
- type "{"
- yankclip "fred"
- type "}"
- )
- (bind '\55' bracketize) ; Keypad 3
-
- (define boldRoman
- cutclip "fred"
- type "{\\bf "
- yankclip "fred"
- type "}"
- )
- (bind '\0b' <cs> boldRoman) ; CMD-SHIFT-B
-
- (define boldSymbol
- cutclip "fred"
- type "\\mbox{\\boldmath\\( "
- yankclip "fred"
- type "\\)}"
- )
- (bind '\0b' <cso> boldSymbol) ; CMD-SHIFT-OPT-B
-
- (define italicize
- cutclip "fred"
- type "{\\em "
- yankclip "fred"
- type "}"
- )
- (bind '\22' <cs> italicize) ; CMD-SHIFT-I
-
- (define calligraphize
- cutclip "fred"
- type "{\\cal "
- yankclip "fred"
- type "}"
- )
- (bind '\08' <cs> calligraphize) ; cmd-shift-c
-
- (define blackboardBoldSelection ; AMS-LaTeX outline font
- cutclip "fred"
- type "{\\Bbb "
- yankclip "fred"
- type "}"
- )
- (bind '\02' <cs> blackboardBoldSelection) ; CMD-SHIFT-D
-
- (define underline
- cutclip "fred"
- type "\\underline{"
- yankclip "fred"
- type "}"
- )
- (bind '\20' <cs> underline) ; CMD-SHIFT-U
-
- (define overline
- cutclip "fred"
- type "\\overline{"
- yankclip "fred"
- type "}"
- )
-
- (define squareRoot
- cutclip "fred"
- type "\\sqrt{"
- yankclip "fred"
- type "}"
- )
-
- (define bar
- cutclip "fred"
- type "\\bar{"
- yankclip "fred"
- type "}"
- )
-
- (define dot
- cutclip "fred"
- type "\\dot{"
- yankclip "fred"
- type "}"
- )
-
- (define doubleDot
- cutclip "fred"
- type "\\ddot{"
- yankclip "fred"
- type "}"
- )
-
- (define tilde
- cutclip "fred"
- type "\\tilde{"
- yankclip "fred"
- type "}"
- )
-
- (define hat
- cutclip "fred"
- type "\\hat{"
- yankclip "fred"
- type "}"
- )
-
- (define invertedHat
- cutclip "fred"
- type "\\breve{"
- yankclip "fred"
- type "}"
- )
-
- (define barredArrow
- type "\\mapsto"
- )
-
- (define plusMinus
- type "\\pm"
- )
-
- (define identicallyEquals
- type "\\equiv"
- )
-
- (define twoWavyEquals
- type "\\approx"
- )
-
- (define oneWavyEquals
- type "\\simeq"
- )
-
- (define lessThanOrEq
- type "\\leq"
- )
-
- (define greaterThanOrEq
- type "\\geq"
- )
-
- (define curlyDee
- type "\\partial"
- )
-
- (define dotsOnLine
- type "\\ldots"
- )
-
- (define infinity
- type "\\infty"
- )
-
- (define del
- type "\\nabla"
- )
-
- (define centredDot
- type "\\cdot"
- )
-
- (define rightArrow
- type "\\rightarrow"
- )
-
- (define leftArrow
- type "\\leftarrow"
- )
-
- (define implies
- type "\\Rightarrow"
- )
-
- (define cross
- type "\\times"
- )
-
- (define belongsTo
- type "\\in"
- )
-
- (define union
- type "\\cup"
- )
-
- (define intersection
- type "\\cap"
- )
-
- (define oneEquation
- saveVars
- set indentOnCR off
- type " \\begin{equation} \\label{eq:xxx}"
- carriageReturn
- type " yyy \\; punctuation"
- carriageReturn
- type " \\end{equation}"
- set forward off
- search "xxx"
- restoreVars
- )
- (bind '\0e' <co> oneEquation) ; cmd-option-e
-
- (define twoEquations
- saveVars
- set indentOnCR off
- type " \\begin{eqnarray} \\label{eq:xxx}"
- carriageReturn
- type " lll & = & rrr"
- carriageReturn
- type " \\; , \\nonumber \\\\"
- carriageReturn
- type " lll & = & rrr"
- carriageReturn
- type " \\; punctuation"
- carriageReturn
- type " \\end{eqnarray}"
- set forward off
- search "xxx"
- restoreVars
- )
- (bind '\11' <co> twoEquations) ; cmd-option-t
-
- (define longEquation
- saveVars
- set indentOnCR off
- type " \\begin{eqnarray} \\label{eq:xxx}"
- carriageReturn
- type " lll & = & rrr\\\\"
- carriageReturn
- type " \\nonumber \\\\"
- carriageReturn
- type " & & \\mbox{} + sss"
- carriageReturn
- type " \\; punctuation"
- carriageReturn
- type " \\end{eqnarray}"
- set forward off
- search "xxx"
- restoreVars
- )
- (bind '\25' <co> longEquation) ; cmd-option-l (L)
-
- (define intFromTo
- saveVars
- type "\\int_{bot}^{top} xxx \\; dz"
- set forward off
- search "bot"
- restoreVars
- )
- (bind '\22' <co> intFromTo) ; cmd-option-i
-
- (define prodFromTo
- saveVars
- type "\\prod_{bot}^{top}"
- set forward off
- search "bot"
- restoreVars
- )
- (bind '\23' <co> prodFromTo) ; cmd-option-p
-
- (define sumFromTo
- saveVars
- type "\\sum_{bot}^{top}"
- set forward off
- search "bot"
- restoreVars
- )
- (bind '\01' <co> sumFromTo) ; cmd-option-s
-
- (define fractionTmplt
- saveVars
- type "\\frac{top}{bot}"
- set forward off
- search "top"
- restoreVars
- )
- (bind '\03' <co> fractionTmplt) ; cmd-option-f
-
- (define section
- saveVars
- type "\\section{xxx} \\label{sec:yyy}"
- set forward off
- search "xxx"
- restoreVars
- )
- (bind '\22' <cso> section) ; cmd-shift-option-i
-
- (define subSection
- saveVars
- type "\\subsection{xxx} \\label{sec:yyy}"
- set forward off
- search "xxx"
- restoreVars
- )
- (bind '\26' <cso> subSection) ; cmd-shift-option-j
-
- (define defineAMS
- set indentOnCR off
- type "\\input{amssym.def} % Allow use of AMS fonts"
- carriageReturn
- type "\\input{amssym}"
- carriageReturn
- set indentOnCR on
- )
-
- (menu LaTeX
- (menu miscSymbols
- "curlyDee"
- "dotsOnLine"
- "infinity"
- "del")
-
- (menu binarySymbols
- "plusMinus"
- "cross"
- "centredDot")
-
- (menu relationSymbols
- "identicallyEquals"
- "twoWavyEquals"
- "oneWavyEquals"
- "lessThanOrEq"
- "greaterThanOrEq"
- "belongsTo"
- "union"
- "intersection")
-
- (menu arrowSymbols
- "implies"
- "barredArrow"
- "rightArrow"
- "leftArrow")
-
- (menu Templates
- "oneEquation"
- "twoEquations"
- "longEquation"
- "intFromTo"
- "prodFromTo"
- "sumFromTo"
- "fractionTmplt"
- "section"
- "subSection")
-
- "(-"
-
- (menu accentSelectedMathChar
- "bar"
- "dot"
- "doubleDot"
- "tilde"
- "hat"
- "invertedHat")
-
- (menu changeSelection
- "boldRoman"
- "boldSymbol"
- "italicize"
- "underline"
- "overline"
- "dollarize"
- "bracketize"
- "calligraphize"
- "squareRoot")
-
- (menu AMSTexFonts
- "defineAMS"
- "blackboardBoldSelection")
- )
-
- (deleteMenu "Misc")
- (deleteMenu "Convert")
- (deleteMenu "Wins")
- (insertMenu "LaTeX")
- (insertMenu "Misc")
- (insertMenu "Convert")
- (insertMenu "Wins")
-